#ifndef HASH_H
#define HASH_H

#include <string>

#include <openssl/sha.h>

class hash_t
{
public:
    hash_t();

    /* calc hash to file in path */
    void make(std::string &path);

    /* hash is equal */
    bool operator == (const hash_t &) const;

    /* to compare hash */
    bool operator < (const hash_t &) const;

    /* true - hash is not calc */
    bool operator ! () const;

    /* sha-512 hash */
    unsigned char data[SHA512_DIGEST_LENGTH];

private:
    bool init;          /* calc hash */
};

#endif // HASH_H
